package com.ngc.mall.core.enumeration;

import java.util.stream.Stream;

/**
 *
 * 优惠券类型
 * @author: chenxiaolin
 * @date 2023/8/22 22:34
**/
public enum CouponType {
    ALL(0,"所有"),
    FULL_MINUS(1, "满减券"),
    FULL_OFF(2,"满减折扣券"),
    NO_THRESHOLD_MINUS(3, "无门槛减除券");
    private Integer value;
    CouponType(Integer value,String description){
        this.value=value;
    };

    public int getValue(){
        return this.value;
    }

    public static CouponType toType(int value){
        return Stream.of(CouponType.values()).filter(c->c.value==value).findAny().orElse(null);
    }
}
